package com.happyfamily.springboot.crowdsourcingplatform.dao.weng;

import com.happyfamily.springboot.crowdsourcingplatform.model.Alliance;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BackAllianceDao
{

	@Select("select count(*) from alliance")
	Long countAllAlliance();

	@Select("select aid,aname,ainfo,atype,sname tips1,amargin,abank,uaccount amasterid,aaccout from alliance a,sys_user s,server_type st where a.amasterid=s.uid and a.atype=st.sid limit #{startPosition},#{limit}")
	List<Alliance> getAllAllianceByPage(Integer startPosition, Integer limit);

	Long getAllianceByFuzzy(String aname, String sid);

	List<Alliance> getAllianceByFuzzyPage(String aname, String sid, Integer startPosition, Integer limit);
}
